package com.cloud.wyf.Mapper;

import com.cloud.wyf.Entity.LeaderShip;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface LeaderShipMapper {

    @Select("select * from leadership where part=#{part}")
    LeaderShip selectLeaderShipByPart(String part);

    @Select("select * from leadership")
    List<LeaderShip> selectAllLeaderShip();

    @Update("update leadership set reportpath=#{reportpath},reporttime=now(),uid=#{uid},status=#{status} where part=#{part}")
    int updateLeaderShip(LeaderShip leaderShip);

    @Select("select count(*) from leadership")
    int selectTotalL();

    @Select("select * from leadership limit #{begin},#{size}")
    List<LeaderShip> selectPageL(@Param("begin") int begin, @Param("size") int size);

    @Update("update leadership set status=#{status} where part=#{part}")
    int updateStatus(@Param("status") int status,@Param("part") String  part);

}
